package com.example.hospital.api.controller.form;

import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

@Data
public class InsertDrugInfForm {
    @NotBlank(message = "drugid不能为空")
    @Pattern(regexp = "^[0-9]{13}$", message = "drugid内容不正确")
    private String drugid;

    @NotBlank(message = "drugname不能为空")
    @Pattern(regexp = "^[\\u4e00-\\u9f5a]{2,20}$", message = "drugname内容不正确")
    private String drugname;

    @NotBlank(message = "drugspec不能为空")
    @Length(max = 20, message = "drugspec内容不正确")
    private String drugspec;

    @NotBlank(message = "drugmade不能为空")
    @Pattern(regexp = "^[\\u4e00-\\u9f5a]{2,20}$", message = "drugmade内容不正确")
    private String drugmade;

    @NotNull(message = "drugstatus不能为空")
    @Range(min = 1, max = 2, message = "drugstatus不能为空")
    private Byte drugstatus;

    @NotBlank(message = "remark不能为空")
    @Length(max = 50, message = "remark内容不正确")
    private String remark;
}
